/* praise2.c -- 使用strlen函数 */

#include <stdio.h>
#include <string.h>
#define PRAISE "You are excellent!"

int main(void) 
{
  char name[40];

  printf("What's your name?\n");
  scanf("%s", name);
  printf("Hello, %s. %s\n", name, PRAISE);
  printf("Your name has %zd letters, and needs %zd bytes to store it.\n", 
    strlen(name), sizeof(name)
  );
  printf("PRAISE has %zd letters, and needs %zd bytes to store it.\n", 
    strlen(PRAISE), sizeof PRAISE
  );

  return 0;
}

